﻿using System;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Data;
using System.Web.UI.WebControls;

public partial class admin_users : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //if (!Page.IsPostBack)
        //{
        //    int companyid = 0;

        //    if (Request.QueryString["companyid"] != null && !Request.QueryString["companyid"].Trim().Equals(""))
        //    {
        //        companyid = int.Parse(Request.QueryString["companyid"].ToString());
        //    }

        //    // como no es vacio significa que tengo que halar los datos
        //    if (companyid!=0)
        //    {
        //        RE_GenericBean company = DB.getCompanyData(companyid);
        //        lb_companyid.Text = company.intC1.ToString();
        //        tb_companyid.Text = company.intC1.ToString();
        //        tb_companyname.Text = company.strC1.Trim().ToUpper();
        //        lb_tipoindustria.SelectedValue = company.intC2.ToString();
        //        rdb_state.SelectedValue = company.intC3.ToString();
        //        tb_companyname.Enabled = false;
        //        tb_companyid.Enabled = false;
        //    }
            
        //    DataSet ds=DB.getCompanyDataDS();
        //    gvd.DataSource = ds.Tables["company"];
        //    gvd.DataBind();
        //}
    }
    protected void gvd_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        //if (e.CommandName == "Edit")
        //{
        //    int index = Convert.ToInt32(e.CommandArgument);
        //    string userid = gvd.Rows[index].Cells[2].Text;
        //    Response.Redirect("client_company.aspx?companyid=" + userid);
        //}
        //if (e.CommandName == "Delete")
        //{
        //    int index = Convert.ToInt32(e.CommandArgument);
        //    string userid = gvd.Rows[index].Cells[2].Text;
        //    int result = DB.deleteCompanyData(userid);
        //}
    }
    protected void btn_save_Click(object sender, EventArgs e)
    {
        //RE_GenericBean company = new RE_GenericBean();
        //company.intC1 = int.Parse(lb_companyid.Text);
        //company.strC1 = tb_companyname.Text;
        //company.intC2 = int.Parse(lb_tipoindustria.SelectedValue);
        //company.intC3 = int.Parse(rdb_state.SelectedValue);
        
        //int result = DB.InsertUpdateCompanyData(company);

    }
    protected void gvd_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Cells[3].Style.Add("display", "none");
        } else if (e.Row.RowType == DataControlRowType.Header) {
            e.Row.Cells[3].Style.Add("display", "none");
        }
    }
}
